package cn.dzhang.spring.boot.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.dzhang.spring.boot.model.User;
import cn.dzhang.spring.boot.service.UserService;

@RestController
@RequestMapping("users")
public class UserController {

	@Autowired
	private UserService userService;

	@RequestMapping
	public List<User> index() {
		return userService.findAll();
	}

}
